import java.util.Scanner;

/**
 * @FileName Question1
 * @Description
 * @Author Sword
 * @date 2024-09-26
 **/
public class Question1 {
    public static void main(String[] args) {
        //编写程序接受用户输入多个整数
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int avg = 0;
        int count = 0;
        while (true) {
            System.out.println("请输入一个整数");
            int num = sc.nextInt();
            if (num == 0) {
                avg = sum / count;
                break;
            }
            sum += num;
            count++;
        }
        //当用户输入的整数为0时显示已输入所有整数的平均值并结束程序。
        System.out.println("平均值为" + avg);
    }
}
